package md.mru.core.domains.administration;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "tree_user_groups", schema = "c##mru_optimized")
public class TreeModelUserGroup implements Serializable {

    private static final long serialVersionUID = -8118007728268411824L;

    @EmbeddedId
    private TreeUserGroupId id;

    @Column(name = "can_write")
    private boolean canWrite;

    public TreeModelUserGroup() {
        super();
    }

    public TreeModelUserGroup(TreeNodeModel treeNodeModel, UserGroup userGroup, boolean canWrite) {
        this.id = new TreeUserGroupId(treeNodeModel, userGroup);
        this.canWrite = canWrite;
    }

    public TreeUserGroupId getId() {
        return id;
    }

    public void setId(TreeUserGroupId id) {
        this.id = id;
    }

    public boolean getCanWrite() {
        return canWrite;
    }

    public void setCanWrite(boolean canWrite) {
        this.canWrite = canWrite;
    }
}


